#include <stdio.h>
#include <stdlib.h>


typedef struct treec
{
	int data;
	struct treec *leftt;
	struct treec *right;
}treenode;

void view(treenode *H);
int main(int argc, const char *argv[])
{
	treenode *a=(treenode *)malloc(sizeof(treenode));
	a->data=1;
	a->leftt=NULL;
	a->right=NULL;

	treenode *b=(treenode *)malloc(sizeof(treenode));
	b->data=2;
	a->leftt=b;
	b->leftt=NULL;
	b->right=NULL;

	treenode *c=(treenode *)malloc(sizeof(treenode));
	c->data=3;
	a->right=c;
	c->leftt=NULL;
	c->right=NULL;

	treenode *d=(treenode *)malloc(sizeof(treenode));
	d->data=4;
	b->leftt=d;
	d->leftt=NULL;
	d->right=NULL;

	treenode *e=(treenode *)malloc(sizeof(treenode));
	e->data=5;
	c->leftt=e;
	e->leftt=NULL;
	e->right=NULL;

	treenode *f=(treenode *)malloc(sizeof(treenode));
	f->data=6;
	c->right=f;
	f->leftt=NULL;
	f->right=NULL;

	treenode *g=(treenode *)malloc(sizeof(treenode));
	g->data=7;
	f->right=g;
	g->leftt=NULL;
	g->right=NULL;

	treenode *h=(treenode *)malloc(sizeof(treenode));
	h->data=8;
	g->leftt=h;
	h->leftt=NULL;
	h->right=NULL;

	treenode *i=(treenode *)malloc(sizeof(treenode));
	i->data=9;
	d->leftt=i;
	i->leftt=NULL;
	i->right=NULL;
	
	view(a);
	printf("\n");

	return 0;
}


void view(treenode *H)
{
	if(H==NULL)
	{
		return;
	}
	else
	{
		view(H->leftt);
		printf("%d ",H->data);
		view(H->right);
	}
	
}

